<template>
	<view>
		<u-tabbar :value="value" @change="navchange" :fixed="true" :placeholder="true" activeColor="#000000"
			inactiveColor="#C8C8C8" :safeAreaInsetBottom="true" :border="false
			">
			<u-tabbar-item text="GPT">
				<image class="u-page__item__slot-icon" slot="active-icon" src="/static/tabbar/gpt1.png"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="/static/tabbar/gpt0.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="AI">
				<image class="u-page__item__slot-icon" slot="active-icon" src="/static/tabbar/ai1.png"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="/static/tabbar/ai0.png"></image>
			</u-tabbar-item>
			<u-tabbar-item>
				<image style="width: 180rpx; height: 180rpx; margin-top: -80rpx; border-radius: 50%;" class="u-page__item__slot-icon"
					slot="active-icon" src="/static/tabbar/logo.png"></image>
				<image style="width: 180rpx; height: 180rpx; margin-top: -80rpx; border-radius: 50%;" class="u-page__item__slot-icon"
					slot="inactive-icon" src="/static/tabbar/logo.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="生态">
				<image class="u-page__item__slot-icon" slot="active-icon" src="/static/tabbar/ecology1.png"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="/static/tabbar/ecology0.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="我的">
				<image class="u-page__item__slot-icon" slot="active-icon" src="/static/tabbar/my1.png"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="/static/tabbar/my0.png"></image>
			</u-tabbar-item>

		</u-tabbar>
	</view>
</template>

<script>
	export default {
		props: {
		    // 当前匹配项的name
		    value: {
		        type: [String, Number, null],
		        default: 0
		    },
		},
		data() {
			return {
			}
		},
		methods: {
			navchange(index) {
				if (index == 0) {
					uni.reLaunch({
						url: '/pages/index/index'
					})
				}
				if (index == 1) {
					uni.reLaunch({ 
						url: '/pages/ai/index'
					})
				}
				if (index == 2) {
					uni.reLaunch({ 
						url: '/pages/base/index'
					})
				}
				if (index == 3) {
					uni.reLaunch({
						url: '/pages/ecology/index'
					})
				}
				if (index == 4) {
					uni.reLaunch({
						url: '/pages/my/index'
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	image {
		width: 63rpx;
		height: 63rpx;
	}
</style>